#ifndef STORAGEUTILITY_H
#define STORAGEUTILITY_H
#include <QDebug>
#include <QFileSystemWatcher>

typedef struct {
    qint64 freeBytes;
    qint64 totalBytes;
} Storage;

class StorageUtility :public QObject{
    Q_OBJECT
public:
    static StorageUtility* getInstance();
    int internalFreePhotoSize();
    int internalFreeVideoSize();
    int externalFreePhotoSize();
    int externalFreeVideoSize();
    bool isHaveEnoughFreeSize();
    bool isHaveDisk();
    ~StorageUtility();
private:
    QStringList m_disk;
    void updateDisk(const QString &path);
    int syncInternalStorageInfo(Storage* info, bool isInternel = true);
    Storage g_internalStorage;
    Storage m_externalStorage;
    StorageUtility();
    QFileSystemWatcher fwatcher;
};

#endif // STORAGEUTILITY_H
